home *** CD-ROM | disk | FTP | other *** search
File List | 1989-10-11 | 3.3 KB | 114 lines |
- '
- ' GFA PRINTER DRIVER
- ' LOAD MODULE
- '
- ' Copyright 1990 Antic Publishing, Inc.
- '
- ' by Know Ware Mfg.
- '
- ' Note: these procedures to load a printer driver may be merged with your own
- ' programs and freely distributed provided this notice is not removed.
- '
- ' ===========================================================================
- '
- Procedure Get_driver
- '
- ' After this procedure is called, D_flag%=1 if an active printer driver was
- ' found in the current directory; D_flag%=0 if an active printer driver was
- ' not found. A driver is active if it has the extension .PDA -- other
- ' drivers have the extension .PDX. To use a printer code, simply follow
- ' Lprint with the variable containing the code value. For example,
- '
- ' Lprint Boldon$
- '
- ' turns bold printing on. See the table accompanying the printer driver
- ' article in the January 1990 issue of START for a summary of values.
- ' (However, most of the variable names are self-explanatory.)
- '
- Local D$
- Void Gemdos(26,L:Basepage+128)
- Driver_name$=Space$(20)
- Drive=Gemdos(&H19)
- Let Dir$=Dir$(Drive+1)
- If Right$(Dir$,1)<>"\"
- Let Dir$=Dir$+"\"
- Endif
- Let Dir$=Mid$("ABCDEFGHIJKLMNOP",Drive+1,1)+":"+Dir$
- D$=Dir$+"*.PDA" !Put your search path here
- Fd$=D$+Chr$(0)
- D_flag%=0
- E_%=Gemdos(78,L:Varptr(Fd$),Attr%)
- If E_%=0
- Open "I",#1,D$
- D_flag%=1
- Bmove Basepage+158,Varptr(Driver_name$),14
- Driver_name$=Left$(Driver_name$,Instr(Driver_name$,Chr$(0))-1)
- Endif
- @Para_to_char(*Align$) !You can substitute your own driver variables
- @Para_to_char(*Linef$)
- If D_flag%=0
- Let Linef$=Chr$(10)
- Endif
- @Para_to_char(*Formf$)
- If D_flag%=0
- Let Formf$=Chr$(12)
- Endif
- @Para_to_char(*Pagel$)
- @Para_to_char(*Italon$)
- @Para_to_char(*Italoff$)
- @Para_to_char(*Boldon$)
- @Para_to_char(*Boldoff$)
- @Para_to_char(*Dblon$)
- @Para_to_char(*Dbloff$)
- @Para_to_char(*Undron$)
- @Para_to_char(*Undroff$)
- @Para_to_char(*Rtmar1$)
- @Para_to_char(*Subon$)
- @Para_to_char(*Supon$)
- @Para_to_char(*Suboff$)
- @Para_to_char(*Wideon$)
- @Para_to_char(*Wideoff$)
- @Para_to_char(*Nlq$)
- @Para_to_char(*Draft$)
- @Para_to_char(*Cpi10$)
- @Para_to_char(*Cpi12$)
- @Para_to_char(*Cpi17$)
- @Para_to_char(*Lpi6$)
- @Para_to_char(*Lpi8$)
- @Para_to_char(*Rtmar2$)
- If D_flag%
- Close #1
- Endif
- Return
- '
- ' ============================================================================
- Procedure Para_to_char(Para_hold%)
- Local Hold$,Holdit$,Ihold$,Prhold$
- If D_flag%
- Line Input #1,Ihold$ !Reads Driver a line at a time
- Jend%=Len(Ihold$)
- J%=0
- Prhold$=""
- If Jend%>0
- While J%<=Jend%
- Do
- Inc J%
- Exit If J%>Jend%
- Holdit$=Mid$(Ihold$,J%,1)
- Exit If Holdit$=","
- Hold$=Hold$+Holdit$
- Loop
- Prhold$=Prhold$+Chr$(Val(Hold$)) !Builds a character string
- Hold$=""
- Wend
- *Para_hold%=Prhold$ !Passes string back to Get_driver
- Else
- *Para_hold%=""
- Endif
- Else
- *Para_hold%="" !Passes blank strings if driver not found
- Endif
- Return
- '
- ' ===========================================================================
-